/*
 * Color4f.cpp
 *
 *  Created on: Mar 20, 2014
 *      Author: knuke
 */

#include "Color4f.hpp"
#include "Types.hpp"
#include <array>

using std::array;

namespace gengine
{

  Color4f::Color4f()
  {
    data_.fill(0.0f);
  }

  Color4f::Color4f(std::array<float, 4> data)
  {
    data_ = data;
  }

  Color4f::Color4f(float* data)
  {
    COUNTER_LOOP(i, 0, 4)
    {
      data_[i] = data[i];
    }
  }

  Color4f::~Color4f()
  {
  }

  float Color4f::getAlpha() const
  {
    return data_[3];
  }

  void Color4f::setAlpha(float alpha)
  {
    data_[3] = alpha;
  }

  float Color4f::getBlue() const
  {
    return data_[2];
  }

  void Color4f::setBlue(float blue)
  {
    data_[2] = blue;
  }

  float Color4f::getGreen() const
  {
    return data_[1];
  }

  void Color4f::setGreen(float green)
  {
    data_[1] = green;
  }

  float Color4f::getRed() const
  {
    return data_[0];
  }

  void Color4f::setRed(float red)
  {
    data_[0] = red;
  }

  const std::array<float, 4>& Color4f::getData() const
  {
    return data_;
  }

  void Color4f::setData(const std::array<float, 4>& data)
  {
    data_ = data;
  }

} /* namespace gengine */
